home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Database How-To / Visual Basic 4 Database - How-to (The Waite Group)(1995).iso / server.ba_ / server.ba
Text File  |  1995-07-05  |  1KB  |  39 lines

  1. Attribute VB_Name = "Module1"
  2. Option Explicit
  3.  
  4. Public Const APP_NAME = "BIBLIO Server"
  5.  
  6. Public LastError As Integer
  7.  
  8. Public Const ERR_DATABASENOTSPECIFIED = 32767
  9. Public Const ERR_CANTFINDRECORD = 32766
  10. Public Const ERR_TOOMANYRECORDS = 32765
  11. Public Const ERR_WRONGVARTYPE = 32764
  12. Public Const ERR_OBJECTNOTINITIALIZED = 32763
  13. Public Const ERR_INVALIDPUBLISHERID = 32762
  14. Public Const ERR_INVALIDAUTHORID = 33761
  15. Public Const ERR_INVALIDISBN = 32760
  16.  
  17.  
  18. Sub Main()
  19. End Sub
  20. Sub ErrorHandler(icons As Integer)
  21.     Dim msg As String
  22.     
  23.     Select Case LastError
  24.         Case ERR_DATABASENOTSPECIFIED
  25.             msg = "No database has been specified."
  26.         Case ERR_CANTFINDRECORD
  27.             msg = "Can't find the specified record."
  28.         Case ERR_TOOMANYRECORDS
  29.             msg = "More than one record exists with the specified value(s)."
  30.         Case ERR_WRONGVARTYPE
  31.             msg = "Did not expect that variant type."
  32.         Case ERR_OBJECTNOTINITIALIZED
  33.             msg = "The object has not been initialized."
  34.         Case Else
  35.             msg = "Error " & LastError
  36.     End Select
  37.     MsgBox msg, icons, APP_NAME
  38. End Sub
  39.